<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>API in modules | Hello, Webpack!</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.4.1">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
    

        
    
    
    <link rel="next" href="../api/loaders.html" />
    
    
    <link rel="prev" href="../api/node.js-api.html" />
    

        
    </head>
    <body>
        
        
    <div class="book" data-level="6.4" data-basepath=".." data-revision="Fri Nov 13 2015 15:10:50 GMT+0800 (CST)">
    

<div class="book-summary">
    <div class="book-search" role="search">
        <input type="text" placeholder="Type to search" class="form-control" />
    </div>
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Introduction
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="start/index.html">
            
                
                    <a href="../start/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        开始
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="start/motivation.html">
            
                
                    <a href="../start/motivation.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        Motivation
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="start/what-is-webpack.html">
            
                
                    <a href="../start/what-is-webpack.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        What is webpack?
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="start/installation.html">
            
                
                    <a href="../start/installation.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        Installation
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="start/usage.html">
            
                
                    <a href="../start/usage.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        Usage
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="start/require-modules.html">
            
                
                    <a href="../start/require-modules.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.</b>
                        
                        Require Modules
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="start/vendor-modules.html">
            
                
                    <a href="../start/vendor-modules.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.</b>
                        
                        Vendor Modules
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="start/using-loaders.html">
            
                
                    <a href="../start/using-loaders.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.7.</b>
                        
                        使用加载器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="start/using-plugins.html">
            
                
                    <a href="../start/using-plugins.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.8.</b>
                        
                        Using Plugins
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="start/dev-tools.html">
            
                
                    <a href="../start/dev-tools.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.9.</b>
                        
                        Dev Tools
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="start/troubleshooting.html">
            
                
                    <a href="../start/troubleshooting.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.10.</b>
                        
                        Troubleshooting
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="tutorials-and-example/index.html">
            
                
                    <a href="../tutorials-and-example/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        TUTORIALS AND EXAMPLES
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="tutorials-and-example/getting-started.html">
            
                
                    <a href="../tutorials-and-example/getting-started.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        Getting started
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="tutorials-and-example/list-of-tutorials.html">
            
                
                    <a href="../tutorials-and-example/list-of-tutorials.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        List of tutorials
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="tutorials-and-example/examples.html">
            
                
                    <a href="../tutorials-and-example/examples.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        examples
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="guides/index.html">
            
                
                    <a href="../guides/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        GUIDES
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="guides/commonjs.html">
            
                
                    <a href="../guides/commonjs.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        CommonJs
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="guides/amd.html">
            
                
                    <a href="../guides/amd.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        AMD
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="guides/webpack-for-browserify-users.html">
            
                
                    <a href="../guides/webpack-for-browserify-users.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        webpack for browserify users
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="guides/code-splitting.html">
            
                
                    <a href="../guides/code-splitting.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.</b>
                        
                        Code Splitting
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="guides/stylesheets.html">
            
                
                    <a href="../guides/stylesheets.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.5.</b>
                        
                        Stylesheets
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="guides/optimization.html">
            
                
                    <a href="../guides/optimization.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.6.</b>
                        
                        Optimization
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.7" data-path="guides/long-term-caching.html">
            
                
                    <a href="../guides/long-term-caching.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.7.</b>
                        
                        Long-term Caching
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.8" data-path="guides/how-to-write-a-loader.html">
            
                
                    <a href="../guides/how-to-write-a-loader.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.8.</b>
                        
                        How to write a loader
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.9" data-path="guides/how-to-write-a-plugin.html">
            
                
                    <a href="../guides/how-to-write-a-plugin.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.9.</b>
                        
                        How to write a plugin
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.10" data-path="guides/multiple-entry-points.html">
            
                
                    <a href="../guides/multiple-entry-points.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.10.</b>
                        
                        Multiple entry points
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.11" data-path="guides/library-and-externals.html">
            
                
                    <a href="../guides/library-and-externals.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.11.</b>
                        
                        Library and externals
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.12" data-path="guides/shimming-modules.html">
            
                
                    <a href="../guides/shimming-modules.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.12.</b>
                        
                        Shimming modules
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.13" data-path="guides/testing.html">
            
                
                    <a href="../guides/testing.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.13.</b>
                        
                        Testing
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.14" data-path="guides/build-performance.html">
            
                
                    <a href="../guides/build-performance.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.14.</b>
                        
                        Build performance
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.15" data-path="guides/hot-module-replacement-with-webpack.html">
            
                
                    <a href="../guides/hot-module-replacement-with-webpack.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.15.</b>
                        
                        Hot Module Replacement with webpack
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.16" data-path="guides/comparison.html">
            
                
                    <a href="../guides/comparison.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.16.</b>
                        
                        Comparison
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" data-path="webpack-with/index.html">
            
                
                    <a href="../webpack-with/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        WEBPACK WITH
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="webpack-with/grunt.html">
            
                
                    <a href="../webpack-with/grunt.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        grunt
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="webpack-with/gulp.html">
            
                
                    <a href="../webpack-with/gulp.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.2.</b>
                        
                        gulp
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="webpack-with/bower.html">
            
                
                    <a href="../webpack-with/bower.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.</b>
                        
                        bower
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4" data-path="webpack-with/karma.html">
            
                
                    <a href="../webpack-with/karma.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.</b>
                        
                        karma
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5" data-path="lists/index.html">
            
                
                    <a href="../lists/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        LISTS
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1" data-path="lists/loader-conventions.html">
            
                
                    <a href="../lists/loader-conventions.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.</b>
                        
                        loader conventions
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="lists/list-of-loaders.html">
            
                
                    <a href="../lists/list-of-loaders.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.</b>
                        
                        List of loaders
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.3" data-path="lists/list-of-plugins.html">
            
                
                    <a href="../lists/list-of-plugins.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.</b>
                        
                        List of plugins
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.4" data-path="lists/list-of-tutorials.html">
            
                
                    <a href="../lists/list-of-tutorials.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.4.</b>
                        
                        List of tutorials
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.5" data-path="lists/list-of-hints.html">
            
                
                    <a href="../lists/list-of-hints.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.5.</b>
                        
                        List of hints
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6" data-path="api/index.html">
            
                
                    <a href="../api/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.</b>
                        
                        API
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.1" data-path="api/configuration.html">
            
                
                    <a href="../api/configuration.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.1.</b>
                        
                        Configuration
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.2" data-path="api/cli.html">
            
                
                    <a href="../api/cli.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.2.</b>
                        
                        CLI
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.3" data-path="api/node.js-api.html">
            
                
                    <a href="../api/node.js-api.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.3.</b>
                        
                        Node.js API
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="6.4" data-path="api/api-in-modules.html">
            
                
                    <a href="../api/api-in-modules.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.4.</b>
                        
                        API in modules
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.5" data-path="api/loaders.html">
            
                
                    <a href="../api/loaders.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.5.</b>
                        
                        Loaders
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.6" data-path="api/plugins.html">
            
                
                    <a href="../api/plugins.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.6.</b>
                        
                        Plugins
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.7" data-path="api/context.html">
            
                
                    <a href="../api/context.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.7.</b>
                        
                        Context
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.8" data-path="api/resolving.html">
            
                
                    <a href="../api/resolving.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.8.</b>
                        
                        Resolving
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.9" data-path="api/hot-module-replacement.html">
            
                
                    <a href="../api/hot-module-replacement.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.9.</b>
                        
                        Hot Module Replacement
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7" data-path="dev-tools/index.html">
            
                
                    <a href="../dev-tools/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.</b>
                        
                        Dev Tools
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.1" data-path="dev-tools/webpack-dev-server.html">
            
                
                    <a href="../dev-tools/webpack-dev-server.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.1.</b>
                        
                        webpack-dev-server
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.2" data-path="dev-tools/webpack-dev-middleware.html">
            
                
                    <a href="../dev-tools/webpack-dev-middleware.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.2.</b>
                        
                        webpack-dev-middleware
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="8" data-path="development/index.html">
            
                
                    <a href="../development/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.</b>
                        
                        DEVELOPMENT
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="8.1" data-path="development/changelog.html">
            
                
                    <a href="../development/changelog.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.1.</b>
                        
                        Changelog
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.2" data-path="development/roadmap.html">
            
                
                    <a href="../development/roadmap.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.2.</b>
                        
                        Roadmap
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.3" data-path="development/ideas.html">
            
                
                    <a href="../development/ideas.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.3.</b>
                        
                        Ideas
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="9" data-path="contributing/index.html">
            
                
                    <a href="../contributing/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.</b>
                        
                        Contributing
                    </a>
            
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    <a href="#" class="btn pull-left toggle-summary" aria-label="Table of Contents"><i class="fa fa-align-justify"></i></a>
    <a href="#" class="btn pull-left toggle-search" aria-label="Search"><i class="fa fa-search"></i></a>
    
    <div id="font-settings-wrapper" class="dropdown pull-left">
        <a href="#" class="btn toggle-dropdown" aria-label="Font Settings"><i class="fa fa-font"></i>
        </a>
        <div class="dropdown-menu font-settings">
    <div class="dropdown-caret">
        <span class="caret-outer"></span>
        <span class="caret-inner"></span>
    </div>

    <div class="buttons">
        <button type="button" id="reduce-font-size" class="button size-2">A</button>
        <button type="button" id="enlarge-font-size" class="button size-2">A</button>
    </div>

    <div class="buttons font-family-list">
        <button type="button" data-font="0" class="button">Serif</button>
        <button type="button" data-font="1" class="button">Sans</button>
    </div>

    <div class="buttons color-theme-list">
        <button type="button" id="color-theme-preview-0" class="button size-3" data-theme="0">White</button>
        <button type="button" id="color-theme-preview-1" class="button size-3" data-theme="1">Sepia</button>
        <button type="button" id="color-theme-preview-2" class="button size-3" data-theme="2">Night</button>
    </div>
</div>

    </div>

    <!-- Actions Right -->
    
    <div class="dropdown pull-right">
        <a href="#" class="btn toggle-dropdown" aria-label="Share"><i class="fa fa-share-alt"></i>
        </a>
        <div class="dropdown-menu font-settings dropdown-left">
            <div class="dropdown-caret">
                <span class="caret-outer"></span>
                <span class="caret-inner"></span>
            </div>
            <div class="buttons">
                <button type="button" data-sharing="twitter" class="button">
                    Share on Twitter
                </button>
                <button type="button" data-sharing="google-plus" class="button">
                    Share on Google
                </button>
                <button type="button" data-sharing="facebook" class="button">
                    Share on Facebook
                </button>
                <button type="button" data-sharing="weibo" class="button">
                    Share on Weibo
                </button>
                <button type="button" data-sharing="instapaper" class="button">
                    Share on Instapaper
                </button>
            </div>
        </div>
    </div>
    

    
    <a href="#" target="_blank" class="btn pull-right google-plus-sharing-link sharing-link" data-sharing="google-plus" aria-label="Google"><i class="fa fa-google-plus"></i></a>
    
    
    <a href="#" target="_blank" class="btn pull-right facebook-sharing-link sharing-link" data-sharing="facebook" aria-label="Facebook"><i class="fa fa-facebook"></i></a>
    
    
    <a href="#" target="_blank" class="btn pull-right twitter-sharing-link sharing-link" data-sharing="twitter" aria-label="Twitter"><i class="fa fa-twitter"></i></a>
    
    
    


    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >Hello, Webpack!</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="api-in-modules">API in modules</h1>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../api/node.js-api.html" class="navigation navigation-prev " aria-label="Previous page: Node.js API"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../api/loaders.html" class="navigation navigation-next " aria-label="Next page: Loaders"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-disqus/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"fontSettings":{"theme":null,"family":"sans","size":2},"disqus":{"shortName":"iwebpack"}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
